package com.wxzz.elearning.common.constants;

import com.alibaba.nacos.api.config.annotation.NacosValue;
import org.springframework.stereotype.Component;

import java.text.SimpleDateFormat;
import java.util.Calendar;

@Component
public class WxLoginConstants {

    public final static String WX_APPID = "wxf0dd4aeb20734e02";


    public final static String WX_SECRET = "52bcaf91fb9e8595db7e52c63e15109d";


    // 授权（必填）
    public final static String WX_GRANT_TYPE = "authorization_code";


    //获取session_key接口
    public final static String WX_GET_SESSION_KEY_URL = "https://api.weixin.qq.com/sns/jscode2session";


    public static String getSysTime(String pattern) {

        return formatSysTime(new SimpleDateFormat(pattern));
    }

    public static String formatSysTime(SimpleDateFormat format) {

        String str = format.format(Calendar.getInstance().getTime());
        return str;
    }
}
